home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 132_01 / fpass2.c < prev    next >
Text File  |  1985-08-19  |  1KB  |  57 lines

  1. /*
  2.     pass 2 writes out those objects in the page list flagged 
  3.     for WRITE and clears all flags except the BLANKED flag.
  4. */
  5.     #ASM
  6. FOROFF    EQU    0
  7. NBYTES    EQU    32
  8. FLGOFF    EQU    2*4
  9. ;pass2(mscan,pgscan,pscrn)
  10. ;int    *mscan,*pgscan,*pscrn;
  11. ;{
  12. ;int    pgflag;
  13. pass2:
  14.     ldx    4,s
  15.     ldy    2,s    ; x ->pgscan , y-> screen
  16. p2wait:
  17.     ldd    SCRADR
  18.     bne    p2wait    ; If display is still on previous page
  19. pass20:
  20. ;    while(pgscan[FORWARD] !=NULL) {
  21.     ldd    FOROFF,x
  22.     cmpd    #0
  23.     beq    pass29
  24. ;        pgflag=pgscan[FLAGS];
  25.         ldd    FLGOFF,x
  26. ;        if(WRITE&pgflag) {
  27.         andb    #32
  28.         beq    pass21
  29. ;            writeobj(pscrn,NBYTES,pgscan[X],pgscan[Y],pgscan[OBJPTR]);
  30.             pshs    x,y    ; save pointers
  31.             pshs    y
  32.             ldd    #32
  33.             pshs    d
  34.             ldd    XOFF,x
  35.             pshs    d
  36.             ldd    YOFF,x
  37.             pshs    d
  38.             ldd    OBJOFF,x
  39.             pshs    d
  40.             jsr    writeobj
  41.             leas    10,s
  42.             puls    x,y
  43. ;    }
  44. pass21:
  45. ;        pgscan[FLAGS]=pgflag&BLANKED;
  46.         ldd    FLGOFF,x
  47.         andb    #1        ; mask off all except blanked
  48.         std    FLGOFF,x
  49. ;        pgscan=pgscan[FORWARD];
  50.         ldx    FOROFF,x
  51. ;    }
  52.         bra    pass20
  53. ;}
  54. pass29:
  55.         rts
  56.     #ENDASM
  57. ═π